var t = require("../../../../@babel/runtime/helpers/typeof");

function e(t) {
    return !!t && (r(t) && (t = +t), !/Invalid|NaN/.test(new Date(t).toString()));
}

function r(t) {
    return /^[\+-]?(\d+\.?\d*|\.\d+|\d\.\d+e\+\d+)$/.test(t);
}

function n(e) {
    switch (t(e)) {
      case "undefined":
        return !0;

      case "string":
        if (0 == e.replace(/(^[ \t\n\r]*)|([ \t\n\r]*$)/g, "").length) return !0;
        break;

      case "boolean":
        if (!e) return !0;
        break;

      case "number":
        if (0 === e || isNaN(e)) return !0;
        break;

      case "object":
        if (null === e || 0 === e.length) return !0;
        for (var r in e) return !1;
        return !0;
    }
    return !1;
}

function u(t) {
    return "function" == typeof Array.isArray ? Array.isArray(t) : "[object Array]" === Object.prototype.toString.call(t);
}

function o(t) {
    return "[object Object]" === Object.prototype.toString.call(t);
}

function i(t) {
    return "function" == typeof t;
}

function a(t) {
    return o(t) && i(t.then) && i(t.catch);
}

function c(t) {
    var e = t.split("?")[0];
    return /\.(jpeg|jpg|gif|png|svg|webp|jfif|bmp|dpg)/i.test(e);
}

function s(t) {
    return /\.(mp4|mpg|mpeg|dat|asf|avi|rm|rmvb|mov|wmv|flv|mkv|m3u8)/i.test(t);
}

var f = Object.freeze(Object.defineProperty({
    __proto__: null,
    amount: function(t) {
        return /^[1-9]\d*(,\d{3})*(\.\d{1,2})?$|^0\.\d{1,2}$/.test(t);
    },
    array: u,
    carNo: function(t) {
        return 7 === t.length ? /^[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领A-Z]{1}[A-Z]{1}[A-HJ-NP-Z0-9]{4}[A-HJ-NP-Z0-9挂学警港澳]{1}$/.test(t) : 8 === t.length && /^[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领A-Z]{1}[A-Z]{1}(([0-9]{5}[DF]$)|([DF][A-HJ-NP-Z0-9][0-9]{4}$))/.test(t);
    },
    chinese: function(t) {
        return /^[\u4e00-\u9fa5]+$/gi.test(t);
    },
    code: function(t) {
        var e = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 6;
        return new RegExp("^\\d{".concat(e, "}$")).test(t);
    },
    contains: function(t, e) {
        return t.indexOf(e) >= 0;
    },
    date: e,
    dateISO: function(t) {
        return /^\d{4}[\/\-](0?[1-9]|1[012])[\/\-](0?[1-9]|[12][0-9]|3[01])$/.test(t);
    },
    digits: function(t) {
        return /^\d+$/.test(t);
    },
    email: function(t) {
        return /^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/.test(t);
    },
    empty: n,
    enOrNum: function(t) {
        return /^[0-9a-zA-Z]*$/g.test(t);
    },
    func: i,
    idCard: function(t) {
        return /^[1-9]\d{5}[1-9]\d{3}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}([0-9]|X)$/.test(t);
    },
    image: c,
    jsonString: function(e) {
        if ("string" == typeof e) try {
            var r = JSON.parse(e);
            return !("object" != t(r) || !r);
        } catch (t) {
            t = VM2_INTERNAL_STATE_DO_NOT_USE_OR_PROGRAM_WILL_FAIL.handleException(t);
            return !1;
        }
        return !1;
    },
    landline: function(t) {
        return /^\d{3,4}-\d{7,8}(-\d{3,4})?$/.test(t);
    },
    letter: function(t) {
        return /^[a-zA-Z]*$/.test(t);
    },
    mobile: function(t) {
        return /^1([3589]\d|4[5-9]|6[1-2,4-7]|7[0-8])\d{8}$/.test(t);
    },
    number: r,
    object: o,
    promise: a,
    range: function(t, e) {
        return t >= e[0] && t <= e[1];
    },
    rangeLength: function(t, e) {
        return t.length >= e[0] && t.length <= e[1];
    },
    regExp: function(t) {
        return t && "[object RegExp]" === Object.prototype.toString.call(t);
    },
    string: function(t) {
        return "string" == typeof t;
    },
    url: function(t) {
        return /^((https|http|ftp|rtsp|mms):\/\/)(([0-9a-zA-Z_!~*'().&=+$%-]+: )?[0-9a-zA-Z_!~*'().&=+$%-]+@)?(([0-9]{1,3}.){3}[0-9]{1,3}|([0-9a-zA-Z_!~*'()-]+.)*([0-9a-zA-Z][0-9a-zA-Z-]{0,61})?[0-9a-zA-Z].[a-zA-Z]{2,6})(:[0-9]{1,4})?((\/?)|(\/[0-9a-zA-Z_!~*'().;?:@&=+$,%#-]+)+\/?)$/.test(t);
    },
    video: s
}, Symbol.toStringTag, {
    value: "Module"
}));

exports.array = u, exports.date = e, exports.empty = n, exports.func = i, exports.image = c, 
exports.number = r, exports.promise = a, exports.test = f, exports.video = s;